package com.bj.common.util;

import java.util.Random;
import org.springframework.stereotype.Component;

/**
 * MD5多重算法正则表达式实现类
 * 
 * @author pengbinxuan
 *
 */
@Component("regexUtil")
public class RegexUtil
{
	public String randStr = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFJHIJKLMNOPQRSTUVWXYZ";

	/**
	 * @param length
	 * @return
	 */
	public String randString(int length)
	{
		StringBuilder sb = new StringBuilder();
		Random rand = new Random();
		for (int i = 0; i < length; i++)
		{
			int dex = rand.nextInt(randStr.length());
			sb.append(randStr.charAt(dex));
		}
		return sb.toString();
	}

}
